//
//  ViewController.m
//  生成二维码
//
//  Created by 石虎 on 2017/6/19.
//  Copyright © 2017年 shihu. All rights reserved.
//

#import "ViewController.h"
#import "QRCodeGenerator.h"

@interface ViewController ()
//显示二维码的图片位置
@property (weak, nonatomic) IBOutlet UIImageView *imageVIew;
//输入文字,
@property (weak, nonatomic) IBOutlet UITextField *textField;
//点击按钮生成二维码 属性
@property (weak, nonatomic) IBOutlet UIButton *codeBtn;
//点击按钮生成二维码
- (IBAction)codeBtnClick:(id)sender;

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];

}



/**
 点击按钮生成二维码

 @param sender 参数
 */
- (IBAction)codeBtnClick:(id)sender {
    
    //创建二维码
    UIImage *codeImage = [QRCodeGenerator qrImageForString:self.textField.text imageSize:self.imageVIew.frame.size.width];
    
    self.imageVIew.image = codeImage;
}
@end
